package com.flowerSystem.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.flowerSystem.entity.OrderListManager;
import com.flowerSystem.entity.Orderlist;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.flowerSystem.entity.Productinformation;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 鲜花遇上牛战士
 * @since 2023-08-28
 */
public interface OrderlistMapper extends BaseMapper<Orderlist> {
    Page<OrderListManager> orderManagerAll();
    IPage<OrderListManager> productInformPrepaid(com.baomidou.mybatisplus.extension.plugins.pagination.Page<OrderListManager> orderListManagerPage);

    IPage<OrderListManager> productInformFinish(com.baomidou.mybatisplus.extension.plugins.pagination.Page<OrderListManager> page);

    @Update("update orderlist set order_status = '待发货' where id = #{id}")
    int productInformTake(int id);

    @Update("update orderlist set order_status = '待收货' where id = #{id}")
    int productInformDelivery(int id);

    OrderListManager orderListFinishLike(String orderNumber);

    public int deleteOderListByOredrNumber(String orderNumber);

    public int updateOrderList(Orderlist orderlist);

    public List<Orderlist> getOrderListbyUser(int userId);

    public Productinformation getProductinformationsById(Integer id);

    void updateOrderListByTime(String orderNumber,String time);

    List<Orderlist> getOrderByOrderNumber(String orderNumber);
}
